package io;

import java.io.*;

public class CopyDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("image.jpg");
        FileOutputStream fos = new FileOutputStream("image_cp2.jpg");
        int len;
        byte[] data = new byte[1024 * 10];
        while ((len = fis.read()) != -1) {
            fos.write(data, 0, len);
        }
        fis.close();
        fos.close();
    }
}
